package com.ssj.ssj.util;


import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author Tiandy
 */
public class ExcelUtil {

    public static final String DATE_FORMAT = "yyyyMMddHHmmss";

    public static String getDateSuffix(){
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATE_FORMAT);
        LocalDateTime localDateTime = LocalDateTime.now();
        return localDateTime.format(formatter);
    }

//    public static void outputFile(HttpServletResponse response, String fileName, Class<?> t, List<?> list) throws IOException {
//        String fName = URLEncoder.encode(fileName, StandardCharsets.UTF_8).replaceAll("\\+", "%20").concat(getDateSuffix());
//        response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
//        response.setCharacterEncoding("UTF-8");
//        response.setHeader("Content-disposition", "attachment;filename=" + fName + ".xlsx");
//        EasyExcel.write(response.getOutputStream(), t).sheet(fName).doWrite(list);
//    }
}
